home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DELPHI / TSMTP32.ZIP / SMTP.INT < prev    next >
Encoding:
Text File  |  1996-06-29  |  3.7 KB  |  110 lines

  1. unit Smtp;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, Windows, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, WinSock, ExtCtrls, DsgnIntf, UUCode, MIME, MailBase,
  8.   MailUtil;
  9.  
  10. type
  11.   TStatus = (msIdle,msConnecting,msLogIn,msLogOut,
  12.              msHeaders,msEnvelope,msBody,msAttachment,
  13.              msCancel,msEnCode);
  14.   TEncoding = (etUU,etMIME);
  15.   TCharSet = (csUSASCII,csISO8859);
  16.   TPriority = (ptLow,ptNormal,ptHigh);
  17.  
  18.   TSMTP = class(TMailBase)
  19.   private
  20.     { Private declarations }
  21.     FFrom : string;
  22.     FRecipient : string;
  23.     FSubject : string;
  24.     FBody : TStrings;
  25.     FCC : TStrings;
  26.     FBCC : TStrings; //new
  27.     FStatus : TStatus;
  28.     FProgress : Integer;
  29.     FAttachments : TStrings;
  30.     FEncoding : TEncoding;
  31.     FCharSet : TCharSet;
  32.     FUseDomainAddress : boolean;
  33.     FReturnReceipt : boolean;
  34.     FPriority : TPriority;
  35.     FOnStatusChange : TNotifyEvent;
  36.     FOnProgress : TNotifyEvent;
  37.     procedure SetBody(Value : TStrings);
  38.     procedure SetCC(Value : TStrings);
  39.     procedure SetBCC(Value : TStrings);
  40.     procedure SetCharSet(Value : TCharSet);
  41.     procedure SetEncoding(Value : TEncoding);
  42.     procedure SetAttachments(Value : TStrings);
  43.     procedure DoStatusChange(Sender : TObject);
  44.     procedure DoProgress(Sender : TObject);
  45.     procedure DummyStatusChange(Sender : TObject);
  46.   protected
  47.     { Protected declarations }
  48.     UULinesList : TList; {List of TStringLists with attachments}
  49.     UniqueID : string;
  50.     Error : boolean;
  51.     Base64 : TBase64;
  52.     QP : TQuotedPrintable;
  53.     UU : TUUCode;
  54.     procedure PrepareUULines;
  55.     procedure PrepareMIMELines;
  56.     procedure EncodeBody;
  57.     procedure SendEnvelope;
  58.     procedure EncodeAttachments;
  59.     procedure CheckForErrors(const s : string);
  60.     procedure RecvData;
  61.     procedure SendBody;
  62.     procedure SendHeaders; virtual;
  63.                 {virtual to allow users to add custom headers}
  64.     procedure SendData(const s : string);
  65.     procedure MIMEProgress(Sender : TObject);
  66.     procedure UUCodeProgress(Sender : TObject);
  67.     procedure ReInit; override;
  68.     function SenderDomain : string;  {11.4}
  69.   public
  70.     { Public declarations }
  71.     constructor Create(AOwner : TComponent); override;
  72.     destructor Destroy; override;
  73.     procedure Open; override;
  74.     procedure LogIn;
  75.     procedure LogOut;
  76.     procedure Send;
  77.     procedure SendSingleMessage;
  78.     procedure Cancel; override;
  79.     property Status : TStatus read FStatus;
  80.     property Progress : Integer read FProgress;
  81.   published
  82.     { Published declarations }
  83.     property Attachments : TStrings read FAttachments write SetAttachments;
  84.     property From : string read FFrom write FFrom;
  85.     property Recipient : string read FRecipient write FRecipient;
  86.     property CC : TStrings read FCC write SetCC;
  87.     property BCC : TStrings read FBCC write SetBCC;
  88.     property Subject : string read FSubject write FSubject;
  89.     property Body : TStrings read FBody write SetBody;
  90.     property Encoding : TEncoding read FEncoding write SetEncoding
  91.                default etMIME;
  92.     property CharSet : TCharSet read FCharSet write SetCharSet;
  93.     property ReturnReceipt : boolean read FReturnReceipt write FReturnReceipt
  94.                default false;
  95.     property Priority : TPriority read FPriority write FPriority
  96.                default ptNormal;
  97.     property UseDomainAddress : boolean read FUseDomainAddress
  98.                  write FUseDomainAddress default true;
  99.     property DefaultPort;
  100.     property OnStatusChange : TNotifyEvent read FOnStatusChange
  101.              write FOnStatusChange;
  102.     property OnProgress : TNotifyEvent read FOnProgress write FOnProgress;
  103.   end;
  104.  
  105. procedure Register;
  106.  
  107. implementation
  108.  
  109.  
  110.